var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var EventManager = require("AA_EventManager");
var ResKeeper = require("AA_ResKeeper");
var EvenType = require("AA_EvenType");
var PlayerDataManager = require("AA_PlayerDataManager");
var Excel = require("AA_Excel");
var GameDataManager = require("AA_GameDataManager");
var GameGlobalVariable = require("AA_GameGlobalVariable");
var HallGlobalVariable = require("AA_HallGlobalVariable");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_DeBugItem = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.typeadd = 0;
    t.togglebeilv1 = null;
    t.togglebeilv2 = null;
    t.jiabeicode = 1;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    this.jiabeicode = 1;
    if (this.togglebeilv1 && this.togglebeilv2) {
      this.togglebeilv1.isChecked = false;
      this.togglebeilv2.isChecked = false;
    }
  };
  _creator.prototype.addHuoBi = function () {
    switch (this.typeadd) {
      case 1:
        PlayerDataManager.PlayerDataMgr.AddDiamond(100 * this.jiabeicode);
        break;
      case 2:
        PlayerDataManager.PlayerDataMgr.AddPower(100 * this.jiabeicode);
        break;
      case 3:
        PlayerDataManager.PlayerDataMgr.AddGold(100 * this.jiabeicode);
        break;
      case 4:
        HallGlobalVariable.default.GetSuiPian([100 * this.jiabeicode, 0, 0]).forEach(function (e, t) {
          PlayerDataManager.PlayerDataMgr.AddEquipFragments(t, e);
        });
        break;
      case 5:
        HallGlobalVariable.default.GetSuiPian([0, 100 * this.jiabeicode, 0]).forEach(function (e, t) {
          PlayerDataManager.PlayerDataMgr.AddEquipFragments(t, e);
        });
        break;
      case 6:
        HallGlobalVariable.default.GetSuiPian([0, 0, 100 * this.jiabeicode]).forEach(function (e, t) {
          PlayerDataManager.PlayerDataMgr.AddEquipFragments(t, e);
        });
        break;
      case 7:
        var e = GameDataManager.GameDataMgr.getNowMaxLevel();
        e += 1;
        var t = Excel.Excel.shuiguoguanqia(e + 1).levelboshuid.length;
        GameDataManager.GameDataMgr.updateLevelBoShu(e, t, 2);
        HallGlobalVariable.default.isNeedResetWareHouse = true;
        EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.HallResetUnLockFurit);
        EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.HallResetBag);
        break;
      case 8:
        var o = Excel.Excel.shuiguotiaozhan(1).levelboshuid.length;
        GameDataManager.GameDataMgr.updateLevelBoShu(1, o, 1);
        break;
      case 9:
        PlayerDataManager.PlayerDataMgr.resetWuJinCount(true);
    }
  };
  _creator.prototype.onClickTen = function () {
    if (10 == this.jiabeicode) {
      this.jiabeicode = 1;
      this.togglebeilv1.isChecked = false;
    } else {
      this.jiabeicode = 10;
      this.togglebeilv2.isChecked = false;
      this.togglebeilv1.isChecked = true;
    }
  };
  _creator.prototype.onClickOpenZhnChun = function () {
    if (this.togglebeilv1.isChecked) {
      this.togglebeilv1.isChecked = false;
      GameGlobalVariable.GameGlobalVariable.isZhanChunBug = false;
    } else {
      this.togglebeilv1.isChecked = true;
      GameGlobalVariable.GameGlobalVariable.isZhanChunBug = true;
    }
  };
  _creator.prototype.onClickTen100 = function () {
    if (100 == this.jiabeicode) {
      this.jiabeicode = 1;
      this.togglebeilv2.isChecked = false;
    } else {
      this.jiabeicode = 100;
      this.togglebeilv1.isChecked = false;
      this.togglebeilv2.isChecked = true;
    }
  };
  __decorate([_property()], _creator.prototype, "typeadd", undefined);
  __decorate([_property(cc.Toggle)], _creator.prototype, "togglebeilv1", undefined);
  __decorate([_property(cc.Toggle)], _creator.prototype, "togglebeilv2", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_DeBugItem;